#include <iostream>

using namespace std;

const int N = 200010;

int n, m;
int res[N];
bool st[N];

struct Op {
    char o;
    int p;
} op[N];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);
    cin >> n >> m;

    for (int i = 0; i < m; ++i) {
        cin >> op[i].o >> op[i].p;
    }

    int l = 0, r = n - 1;
    for (int i = m - 1; i >= 0; --i) {
        if (st[op[i].p]) continue;
        if (op[i].o == 'R') res[r--] = op[i].p;
        else res[l++] = op[i].p;
        st[op[i].p] = true;
    }

    for (int i = 1; i <= n; ++i) if (!st[i]) res[l++] = i;

    for (int i = 0; i < n; ++i) cout << res[i] << ' ';

    cout << '\n';
    return 0;
}